package cn.ylyhappy.netdemo

interface HttpApi {
    /**
     * 抽象的http的get请求封装，异步请求
     */
    fun get(params: Map<String, Any>, path: String, callback: IHttpCallback)

    /**
     * 抽象的http的get请求封装，同步请求
     */
    fun getSync(params: Map<String, Any>, path: String): Any? {
        return Any()
    }

    /**
     * 抽象的http的post请求封装，异步请求
     */
    fun post(body: Any, path: String, callback: IHttpCallback)

    /**
     * 抽象的http的post请求封装，同步请求
     */
    fun postSync(params: Map<String, Any>, path: String): Any? {
        return Any()
    }
    fun cancelRequest(tag:Any)
    fun cancelAllRequest()
}